package com.nowcoder;

import java.util.HashMap;
import java.util.Map;

/**
 * @author by lvshh
 * @version 1.0
 * @date 2020/5/5 23:20
 */
public class testThread implements Runnable {

    static Map<Integer,Object> map = new HashMap<>();
    @Override
    public void run() {

        for (int i = 0; i < 1000; i++) {
            map.put(i,i);
            System.out.println(Thread.currentThread().getName() + ":" +map.get(i));

        }
    }

    public static void main(String[] args) {

        testThread t = new testThread();
        //testThread t2 = new testThread();
       new Thread(t,"t1").start();
       new Thread(t,"t2").start();



    }
}
